<template>
<div>
  <h1>欢迎你{{tea}}</h1>
  <h4>你的学生有</h4>
  <ul v-for="i in student">
    <li>{{i.name}}</li>
  </ul>

</div>
</template>

<script>
export default {
  name: "Teacher",
  data(){
    return{
      student:[],
      tea:'',
      userid:localStorage.getItem('userid')
    }
  },
  methods:{
    student_show(){
      this.$axios.get('users/Student_API/?userid='+this.userid)
      .then(i=>{
        this.student = i.data.list
        this.tea=i.data.list[0].teacher
      })
    }
  },
  mounted() {
    this.student_show()
  }
}
</script>

<style scoped>

</style>
